﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FTradeCatheringListEasyUI2.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.FTradeModel.FTradeCatheringListEasyUI2" %>

<%--收款记录表--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../EasyUI/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../EasyUI/themes/icon.css" />
	<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>   
	<script type="text/javascript" src="../EasyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../EasyUI/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../EasyUI/easyui-formatter_20140718.js"></script>
     <link href="../themes/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script src="../js/DWZ/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="../js/DWZ/jquery.inputValue.js" type="text/javascript"></script>
    <script type="text/javascript">
        ///自适应宽高
       $(window).resize(function(){		    
             $("#tab_list2").datagrid({
                    width: '100%',
                    height:$(parent.document).find("#ftradecatheringiframe").height() > 0 ? $(parent.document).find("#ftradecatheringiframe").height() : 500
             }); 
	    });

        $(document).ready(function () {
            //加载数据
            //alert($(parent.document).find("#ftradecatheringiframe").attr("id"));
            InitGird2();           
        })
        //加载列表数据
        function InitGird2() {
            $('#tab_list2').datagrid({               
                url: location.href, //请求数据的页面
                sortName: 'State', //排序字段
                sortOrder: 'ASC', //排序类型
                idField: 'FCatheringId', //标识字段,主键
                iconCls: '', //标题左边的图标
                width: '100%', //宽度    
                height: $(parent.document).find("#ftradecatheringiframe").height() > 0 ? $(parent.document).find("#ftradecatheringiframe").height() : 500,
                nowrap: false, //是否换行，True 就会把数据显示在一行里
                striped: true, //True 奇偶行使用不同背景色
                collapsible: false, //可折叠
                singleSelect: true, //是否只能选中一条
                remoteSort: true, //定义是否从服务器给数据排序
                fitColumns:false,
                frozenColumns: [[//冻结的列，不会随横向滚动轴移动
                    {title:'经销商',field:'JingXiaoShang',width: 80,sortable:true, rowspan:2, formatter:function(value, row, index){
                         if(value==undefined || value=="")
                                return "合计:";
                        return value;
                    }}
				]],
                columns: [
                    [
                        <%=GetColumnsJS() %> 
                    ],
                    [     
                        <%=GetColumnsJS2() %> 
                    ]
                ],
                toolbar: "#tab_toolbar2",
                queryParams: { "action": "query" },
                pagination: false, //是否开启分页
                pageNumber: 1, //默认索引页
                pageSize: <%=numPerPage %>, //默认一页数据条数
                pageList:<%=SetnumPerPage() %>,
                rownumbers: true, //行号
                showFooter: true,
                onClickCell:function(rowIndex,field,value){   
                    if(value==undefined || value==0 || field=="JingXiaoShang")
                        return false;                 
                    var JingXiaoShang=$('#tab_list2').datagrid('getRows')[rowIndex].JingXiaoShang
                   
                    var _KuanXiangLeiXing = field.split("_")[0];
                    var _fdate = field.split("_")[1];
                    var _tdate =  field.split("_")[2];
                    
                    window.parent.tab2_onClickCell(JingXiaoShang,_KuanXiangLeiXing,_fdate,_tdate);
                   
                    return false;
                }
            });

        }       
       
        /*每行的操作处理*/
        function hrefClickProc(value, row, index)
        {
            if(value==undefined && value=="")
                return "";
            if(row.JingXiaoShang=="")
                  return milliformatter(value);
            return "<a href='#'>"+milliformatter(value,2)+"</a>"
        }

       function onAdjSearch2()
       {
            var $url="FTradeCatheringListEasyUI2.aspx?year="+$("#Year option:selected").val()+"&month="+$("#Month option:selected").val();
            $(parent.document).find("#ftradecatheringiframe").attr("src",$url);
            return false;
       }
       
       function onExport()
       {
            var href = "<%= ExportExcelWebUrl%>/FTradeModel/FTradeCatheringListEasyUI2.aspx?"+ jQuery.param($("#tab_toolbar2").serializeJSON());;
            top.window.open(href, "");
       }
    </script>
   
</head>
<body style="margin:0px;" >

    <div id="tab_list2"></div>
    <div id="tab_toolbar2" style="padding:2px;">
       <span style="line-height:26px;width:60px; font-weight:bold; color:Red; ">快速查看:</span>
        <select id="Year" name="Year" onchange="onAdjSearch2()">
                 <%=GetYearList()%>
        </select>
        <select id="Month" name="Month" onchange="onAdjSearch2()">
                 <option value="1" <%=Month==1?"selected":"" %>>1月</option>
                        <option value="2" <%=Month==2?"selected":"" %>>2月</option>
                         <option value="3" <%=Month==3?"selected":"" %>>3月</option>
                         <option value="4" <%=Month==4?"selected":"" %>>4月</option>
                         <option value="5" <%=Month==5?"selected":"" %>>5月</option>
                        <option value="6" <%=Month==6?"selected":"" %>>6月</option>
                         <option value="7" <%=Month==7?"selected":"" %>>7月</option>
                         <option value="8" <%=Month==8?"selected":"" %>>8月</option>
                         <option value="9" <%=Month==9?"selected":"" %>>9月</option>
                        <option value="10" <%=Month==10?"selected":"" %>>10月</option>
                         <option value="11" <%=Month==11?"selected":"" %>>11月</option>
                         <option value="12" <%=Month==12?"selected":"" %>>12月</option>  
        </select>
        <input type="hidden" name="uid" value="<%=User.UserId %>" />
        <a href="#"   class="easyui-linkbutton" iconcls="icon-btnDown" plain="true"  Permission="r导出" onclick="return onExport()">导出</a>
    </div> 

</body>
</html>